import type { BannerItem, CategoryItem, HotItem } from '@/types/home'
import type { PageResult, PageParams, GoodsItem } from '@/types/global'
import { http } from "@/utils/http"

//获取banner数据
export const getHomeBannerAPI = (distributionSite = 1) => {
    return http<BannerItem[]>({
        method: 'GET',
        url: '/home/banner',
        data: {
            distributionSite,
        },
    })
}

//获取分类数据
export const getHomeCategoryAPI = () => {
    return http<CategoryItem[]>({
        method: 'GET',
        url: '/home/category/mutli'
    })
}

//获取热门推荐
export const getHomeHotAPI = () => {
    return http<CategoryItem[]>({
        method: 'GET',
        url: '/home/hot/mutli'
    })
}

//猜你喜欢
export const getHomeGoodsGuessLikeAPI = (data?: PageParams) => {
    return http<PageResult<GuessItem>>({
        method: 'GET',
        url: '/home/goods/guessLike',
        data,
    })
}